home *** CD-ROM | disk | FTP | other *** search
/ Invenzioni & Inventori / Invenzioni and Inventori (Eclectica Publishing) (1996).ISO / invenzio / vivid / getat2.dir / 00107_Script_107 < prev    next >
Text File  |  1996-11-09  |  4KB  |  124 lines

  1. on caricax
  2.   global mywindow_ffg,FILENAME,BOOK_PATH,pointer
  3.   
  4.   
  5.   if objectp(mywindow_ffg) then    forget myWindow_ffg
  6.   
  7.   put char 1 to offset(".",FILENAME)-1 of FILENAME into name_
  8.   -- open file 
  9.   if the machinetype = 256 then
  10.     set file=fileio(mnew,"read",BOOK_PATH&"\"&name_&".bok")
  11.   else
  12.     set file=fileio(mnew,"read",BOOK_PATH&":"&name_&".bok")
  13.   end if
  14.   set pointer to value(file(mReadFile))
  15.   file(mdispose)
  16.   
  17.   -- open window (for cast copy)
  18.   
  19.   set mywindow_ffg to window("pippo")
  20.   if the machinetype = 256 then
  21.     set the filename of myWindow_ffg to BOOK_PATH&"\"&name_
  22.   else
  23.     set the filename of myWindow_ffg to BOOK_PATH&":"&name_
  24.   end if
  25.   
  26.   set the titlevisible of myWindow_ffg to false
  27.   set the visible of mywindow_ffg to false
  28.   copyciclex
  29.   
  30. end
  31. on copyciclex
  32.   
  33.   global pointer,lista,mywindow_ffg
  34.   set start_=500
  35.   set start_2 to 600
  36.   set lista=[]
  37.   set loop=0
  38.   repeat with loop=0 to (count(pointer)/3-1)
  39.     if the freebytes <100000 then
  40.       alert "MEMORIA INSUFFICIENTE PER CONTENERE TUTTI GLI OGGETTI."
  41.       exit repeat
  42.     end if
  43.     set tipo=value(getat(pointer,loop*3+1))
  44.     if tipo=-1 then exit repeat --esce se finito il ciclo
  45.     set tipo2=getat(pointer,loop*3+2)
  46.     if tipo2 = "#bitmap2" then
  47.       duplicate cast 599,start_
  48.       set the filename of cast start_ to getat(pointer,loop*3+4)  
  49.       set cx to the width of cast start_ /2
  50.       set cy to the height of cast start_ /2
  51.       set the regpoint of cast start_ to point (cx,cy)
  52.       
  53.       --      importfileinto cast start_,getat(pointer,loop*3+4)  
  54.       add lista,[#DESC:getat(pointer,loop*3+3),#PATH:"non used",#TEXT:EMPTY,#CAST:start_]
  55.     end if
  56.     
  57.     if tipo=#digitalvideo then --▓ un filmato e quindi lo carica...
  58.       
  59.       SET FFF TO FILEIO(MNEW,"READ",getat(pointer,loop*3+4))
  60.       IF OBJECTP(FFF) THEN
  61.         set ree = fff(mgetlength)
  62.         FFF(MDISPOSE)
  63.       END IF
  64.       
  65.       
  66.       set start_movie to start_2
  67.       set the filename of  member start_2 to getat(pointer,loop*3+4)
  68.       set start_2 to start_2 +1
  69.       
  70.       if  ree/1024>900  then 
  71.         set the directtostage of cast start_movie to 1
  72.         set the controller of cast  start_movie to 1
  73.         set waay to "control"
  74.       else
  75.         set waay to "nocontrol"
  76.       end if
  77.       
  78.       set the pausedatstart of cast start_movie  to 1
  79.       add lista,[#DESC:getat(pointer,loop*3+3),#PATH:waay,#TEXT:EMPTY,#CAST:start_movie]
  80.       
  81.     end if
  82.     
  83.     
  84.     
  85.     
  86.     if tipo=#text then -- Φ un testo e quindi setta la lista e basta
  87.       add lista,[#DESC:getat(pointer,loop*3+2),#PATH:"non used",#TEXT:getat(pointer,loop*3+3),#CAST:EMPTY]
  88.     end if
  89.     
  90.     if tipo=#bitmap then -- qui Φ un'altra storia in quanto dobbiamo utilizzare il BASIC.dir (la sua copia...)
  91.       global NUMERO_CAST,DATI_BITMAP
  92.       set NUMERO_CAST= value(getat(pointer,loop*3+3))
  93.       
  94.       SET TRY to 0
  95.       SET DATI_BITMAP to 0
  96.       repeat While 1
  97.         set TRY = TRY+1
  98.         tell mywindow_ffg to Get_cast
  99.         if PICTUREP(DATI_BITMAP) or TRY>5 then exit REPEAT  
  100.         REPEAT With rrec= 1 to 200
  101.         END REPEAT
  102.         
  103.       end repeat
  104.       
  105.       
  106.       if the freebytes>500000 then
  107.         duplicate cast 31,cast start_
  108.         if PICTUREP(DATI_BITMAP) then 
  109.           set the picture of cast start_ to DATI_BITMAP
  110.           set cx to the width of cast start_ /2
  111.           set cy to the height of cast start_ /2
  112.           set the regpoint of cast start_ to point (cx,cy)
  113.         end if
  114.         
  115.         add lista,[#DESC:getat(pointer,loop*3+3),#PATH:"non used",#TEXT:EMPTY,#CAST:start_]
  116.       end if
  117.       
  118.     end if
  119.     set start_=start_+1
  120.   end repeat
  121.   add lista,-1 
  122.   forget mywindow_ffg
  123. end 
  124.